import Vue from 'vue'
import VueRouter from 'vue-router'
import Info from '../views/Info.vue'

Vue.use(VueRouter)

const routes = [
    {   path:'/',
        redirect:'/tab/films/nowPlaying'
    },
    {
        path:'/tab',
        name:'Tab',
        component:() => import('../views/Tab.vue'),
        children:[
            { 
                path: 'films', 
                name:'Films',
                component:() => import('../views/films/Films.vue'),
                children:[
                    {
                        path: 'nowPlaying', 
                        name:'NowPlaying',
                        component:() => import('../views/films/NowPlaying.vue')
                    },
                    {
                        path: 'comingSoon', 
                        name:'ComingSoon',
                        component:() => import('../views/films/ComingSoon.vue')
                    }
                ]
            },
            {
                path: 'info', 
                name:'Info',
                component:Info,
                meta:{
                    isNav:true
                }
            },
            {
                path: 'personal', 
                name:'Personal',
                component:() => import('../views/Personal.vue')
            },
            {
                path:'/detail',
                name:'Detail',
                component:() => import('../views/films/Detail.vue')
            }
        ]
    },
    {
        path:'/city',
        name:'City',
        component:() => import('../views/City.vue')
    }
   
]

const router = new VueRouter({
    routes,
    mode:'history'
})

export default router